package com.pq.service.impl;

import com.pq.dao.order.OrderTableDao;
import com.pq.pojo.order.OrderTable;
import com.pq.service.order.OrderTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OrderTableServiceImpl implements OrderTableService {

    @Autowired
    private OrderTableDao orderTableDao;

    @Override
    public int saveOrder(Map<String, Object> map) {
        return orderTableDao.saveOrder(map);
    }

    @Override
    public int saveOrderTable(Integer orderId, List<Long> orderCartIds) {
        return orderTableDao.saveOrderTable(orderId, orderCartIds);
    }

    @Override
    public OrderTable findOrderByOrderId(Integer orderId) {
        return orderTableDao.findOrderByOrderId(orderId);
    }

    @Override
    public int updateOrderByOrderId(Integer siteId, Integer userId, Integer orderId) {
        return orderTableDao.updateOrderByOrderId(siteId, userId, orderId);
    }

    @Override
    public int saveOrderPay(Integer orderId) {
        return orderTableDao.saveOrderPay(orderId);
    }

    @Override
    public OrderTable findByOrderId(Integer orderId) {
        OrderTable orderTable = orderTableDao.findByOrderId(orderId);
        return orderTable;
    }
}
